<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript" src="./js/angular.min.js"></script>
</head>
<body ng-app="myApp" ng-controller="myAppController"> 
<p ng-repeat="x in userList">{{x.id}}-----{{x.name}}-----{{x.type | userType}}</p>
</body>
<script type="text/javascript">
var myApp = angular.module('myApp',[]);
myApp.controller('myAppController',['$scope',function($scope){
	$scope.userList = [
		{id:1,name:'刘备',type:2},
		{id:2,name:'刘禅',type:1},
		{id:3,name:'关羽',type:0},
		{id:4,name:'张飞',type:0},
		{id:5,name:'赵云',type:0}
	];
}]);
myApp.filter('userType',function(){
    return function (userType){
        if(userType == 0){
            return "普通成员";
        }else if(userType == 1){
            return "专业负责人";
        }else if(userType == 2){
            return "项目负责人";
        };
    };
});
</script>
</html>